#pragma once

#include <gofcl_timer_r.h>

typedef struct {
	u16_s CCSE : 1;
	u16_s : 1;
	u16_s CCUC : 1;
	u16_s DMAS : 1;
	u16_s MMC : 3;
	u16_s TI0S : 1;
	u16_s ISO0 : 1;
	u16_s ISO0N : 1;
	u16_s ISO1 : 1;
	u16_s ISO1N : 1;
	u16_s ISO2 : 1;
	u16_s ISO2N : 1;
	u16_s ISO3 : 1;
	u16_s : 1;
} timer_ctl1_s;

_Static_assert(sizeof(timer_ctl1_s) == 2, "Struct timer_ctl1_s defined error!");

static inline void timer_wreg_ctl1_s(timer_qe timer_q, timer_ctl1_s ctl1) {
	union {
		timer_ctl1_s c;
		u16_s u;
	} cu = {
		.c = ctl1,
	};
	timer_wreg_u16(timer_q, TIMER_CTL1_R, T16B_0_R, cu.u);
}
